<%@page import="java.util.HashMap"%>
<%@page import="goomi.talk.talkService"%>
<%@page import="java.util.Map"%>
<%@page import="java.util.ArrayList"%>
<%@page import="goomi.picture.pictureService"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
pictureService pic = new pictureService();
talkService talk = new talkService();

ArrayList picList = pic.getPicture("user");
ArrayList talks = talk.getTalk("all");

%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=BIG5">
<title>Insert title here</title>
<script type="text/javascript">
function uploadPic(){
	$('#UploadForm').each(function(){
        this.reset();
	});
	$('#uploadDiv').show();
}

function afterUpload(){
	$('#d6').load("jsp/GoomiFamily/goomiFamily2.jsp");
}

$(document).ready(function() {
	$('#uploadDiv').hide();
	$('#upload').hide();
	$('#uploadBut').button().click(function(){
		uploadPic();
	});
});
</script>
</head>
<body>
<table>
<%
for(int i = 0 ; i < picList.size() ; i++){
	Map item = (Map)picList.get(i);
%>
<tr>
<td valign="top"><%=item.get("name") %> 於 <%=item.get("create_date") %> 上傳了圖片.</td>
</tr>
<%
}
%>

<%
HashMap typeWord = new HashMap();
typeWord.put("talk_main","討論主題");
typeWord.put("talk_detail","討論回應");
typeWord.put("knowledge_main","知識主題");
typeWord.put("knowledge_detail","知識回應");
typeWord.put("info_main","知識交流主題");
typeWord.put("info_detail","知識交流回應");
typeWord.put("qa_main","問題");
typeWord.put("qa_detail","問題回應");
typeWord.put("news_main","Goomi新知");
typeWord.put("news_detail","Goomi新知補充");
typeWord.put("goodnews_main","GOOMI好消息");
typeWord.put("goodnews_detail","GOOMI好消息補充");



for(int i = 0 ; i < talks.size() ; i++){
	Map item = (Map)talks.get(i);
	String type = (String)item.get("type");
	if(type != null){
		type = (String)typeWord.get(type);
	}else {
		continue;
	}
%>
<tr>
<td valign="top"><%=item.get("member_id") %> 於 <%=item.get("create_date") %> 發表了  <%=type %> .</td>
</tr>
<%
}
%>
</table>
</body>
</html>